import { createStore } from "vuex";

export default createStore({
    state:{
        playList: [
            {//播放列表
            al: {
                id:151310678,
                name:"IKUN",
                pic:109951167860540100,
                picUrl:"http://p4.music.126.net/Lpgc8PwsjnfHqY6OnhbkcA==/109951167860540102.jpg",
                pic_str:"109951167860540102"
            },
            ar:[ {
                name: "蔡徐坤"
            }],
            id: 1987471055,
            name:'只因你太美',
        }
    ],
        playListIndex: 0,//默认为0
        zanting:true,//暂停按钮
        detileShow:false,
        duration:0,//歌曲总时长
        currentTime:0//当前时间，初始值为0
    },
 mutations:{
        updatezanting(state,value){
            state.zanting=value
        },
        pushplayList(state,value){
            // delete state.playList[0]
            state.playList.push(value)
            // state.playList.splice(0,1,value)
            // console.log(state.playList);
        },
        updateplayList(state,value){
            state.playList=value
        },
        updateplayListIndex(state,value){
            state.playListIndex=value
        },
        updateDetileShow(state){
            state.detileShow=!state.detileShow
        },
        updateDuration(state,value){
            state.duration=value
        },
        updateCurrentTime(state,value){
            state.currentTime=value
        },

    }
    // const actions={
    //     zantingf({commit}){
    //         commit('zantingf')
    //     },
    //     playListgx({commit}){
    //         commit('playListgx')
    //     },
    //     playListIndexgx({commit}){
    //         commit('playListIndexgx')
    //     },
    //     updateDetileShow({commit}){
    //         commit('updateDetileShow')
    //     },
        
    // }
})